//
//  SystemListModel.m
//  51易借
//
//  Created by 张睿 on 2017/9/8.
//  Copyright © 2017年 张睿. All rights reserved.
//

#import "SystemListModel.h"

@implementation SystemListModel


+ (instancetype)modelWithDictionary:(NSDictionary *)dic{
    
    SystemListModel *model =[[SystemListModel alloc] init];
    
    [model setValuesForKeysWithDictionary:dic];
    
    return model;
}


+(void)systemListWithSucess:(void (^)(NSArray<SystemListModel *> *))sucessBlock error:(void (^)())errorBlock{
    
    NSDictionary * parameters = @{@"page":@"1",@"size":@"50"};
    
    [[NetworkTool shareManager] POST:@"content/message/loadMyMsgList.json" parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *  _Nullable responseObject) {
        
        NSLog(@"==%@",responseObject);
        
//        NSArray * paramArray = responseObject[@"param"];
//        //        NSArray * array = paramDict[@"list"];
//        
//        NSMutableArray *mArray = [NSMutableArray array];
//        
//        [paramArray enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//            
//            SystemMessageListModel * model = [SystemMessageListModel modelWithDictionary:obj];
//            
//            [mArray addObject:model];
//            
//        }];
//        
//        if(sucessBlock){
//            sucessBlock(mArray.copy);
//        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    
}


- (void)setValue:(id)value forKey:(NSString *)key{
    
    if ([key isEqualToString:@"id"]) {
        
        self.ID = value;
    }else{
        
        [super setValue:value forKey:key];
    }
    
}


-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
}

@end
